<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%@ include file="../common/common.jsp" %>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>${menu_name }</title>
</head>
<link href="${ctx }/static/plugins/chosen_v1.6.2/chosen.css" rel="stylesheet" />
<body <%@ include file="../common/skin.jsp" %>>
<%@ include file="../common/head.jsp" %>
<%@ include file="../common/menu.jsp" %>
<div class="J_content">
    <div class="mt20 plr20">
        <form action="${ctx }/patient/list" id="queryForm" method="post">
            <div class="J_toolsBar clearfix">
                <div class="t_label">名称</div>
                <div class="t_text ml10">
                    <input placeholder="请输入名称" type="text" name="userName" id="userName" value="${userQueryDTO.userName }"/>
                </div>
                <div class="t_button mgl30">
                    <a class="abtn red" href="javascript:myQuery();">
                        <i class="icon"></i>查询
                    </a>
                </div>
                <div class="t_button ml10">
                    <a class="abtn maxblue" href="javascript:myExport();">
                        <i class="icon"></i>导出
                    </a>
                </div>
                <div class="t_label ml10">
                    记录数：<label style="color: red;" id="total">${page.totalCount }</label>
                </div>
            </div>

            <div class="J_table mt20">
                <div class="t_table">
                    <table>
                        <thead>
                        <tr>
                            <td>
                                <span>序号</span>
                            </td>
                            <td>
                                <span>患者姓名</span>
                            </td>
                            <td>
                                <span>姓别</span>
                            </td>
                            <td>
                                <span>民族</span>
                            </td>
                            <td>
                                <span>年龄</span>
                            </td>
                            <td>
                                <span>身份证号</span>
                            </td>
                            <td>
                                <span>手机号</span>
                            </td>
                            <td>
                                <span>QQ</span>
                            </td>
                            <td>
                                <span>Email</span>
                            </td>
                            <td>
                                <span>微信</span>
                            </td>
                            <td>
                                <span>身份证照片</span>
                            </td>
                            <td>
                                <span>救助申请书</span>
                            </td>
                            <td>
                                <span>X光照片</span>
                            </td>
                            <td>
                                <span>创建时间</span>
                            </td>
                        </tr>
                        </thead>
                        <tbody>
                        <c:choose>
                            <c:when test="${page.list != null && page.totalCount > 0 }">
                                <c:forEach items="${page.list }" var="u" varStatus="status">
                                    <tr>
                                        <td>
                                            <div class="t_text tc">
                                                    ${status.index+1 }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${u.name }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${u.sex }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${u.nation }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${u.age }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                    ${u.identityCard }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_link">
                                                    ${u.mobile }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_link">
                                                    ${u.qq }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_link">
                                                    ${u.email }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_link">
                                                    ${u.wechat }
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_link">
                                                <%--<a href="${ctx }${u.idCardPhoto }" target="_blank" style="border:0px;display:inline;">--%>
                                                    <%--<img src="${ctx }${u.idCardPhoto }" width="100" height="100"/>--%>
                                                <%--</a>--%>
                                                <script>
                                                    var idCardPhoto = '${u.idCardPhoto }';
                                                    var strs= new Array(); //定义一数组
                                                    strs = idCardPhoto.split(";"); //字符分割
                                                    for (i=0; i < strs.length-1 ;i++ )
                                                    {
                                                        document.write('<div style="display:inline;">')
                                                        document.write('<a href="${ctx }' + strs[i] +'" target="_blank" style="border:0px;display:inline;">');
                                                        document.write('<img src="${ctx }' + strs[i] +'" width="100" height="100" style="display:inline;"/>');
                                                        document.write('</a></div>')
                                                    }
                                                </script>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_link">
                                               <%--<a href="${ctx }${u.helpApplication }" target="_blank" style="border:0px;display:inline;">--%>
                                                   <%--<img src="${ctx }${u.helpApplication }" width="100" height="100"/>--%>
                                               <%--</a>--%>
                                                <script>
                                                    var helpApplication = '${u.helpApplication }';
                                                    var strs= new Array(); //定义一数组
                                                    strs = helpApplication.split(";"); //字符分割
                                                    for (i=0; i < strs.length-1 ;i++ )
                                                    {
                                                        document.write('<div style="display:inline;">')
                                                        document.write('<a href="${ctx }' + strs[i] +'" target="_blank" style="border:0px;display:inline;">');
                                                        document.write('<img src="${ctx }' + strs[i] +'" width="100" height="100" style="display:inline;"/>');
                                                        document.write('</a></div>')
                                                    }
                                                </script>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_link">
                                                <script>
                                                    var xPhoto = '${u.xPhoto }';
                                                    var strs= new Array(); //定义一数组
                                                    strs = xPhoto.split(";"); //字符分割
                                                    for (i=0; i < strs.length-1 ;i++ )
                                                    {
                                                        document.write('<div style="display:inline;">')
                                                        document.write('<a href="${ctx }' + strs[i] +'" target="_blank" style="border:0px;display:inline;">');
                                                        document.write('<img src="${ctx }' + strs[i] +'" width="100" height="100" style="display:inline;"/>');
                                                        document.write('</a></div>')
                                                    }
                                                </script>
                                                <%--<a href="${ctx }${u.xPhoto }" target="_blank" style="border:0px;display:inline;">--%>
                                                    <%--<img src="${ctx }${u.xPhoto }" width="100" height="100"/>--%>
                                                <%--</a>--%>

                                            </div>
                                        </td>
                                        <td>
                                            <div class="t_text tc">
                                                <fmt:formatDate value="${u.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                            </div>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <tr>
                                    <td colspan="15">
                                        <div class="J_null mt40">
                                            <img src="${ctx }/static/images/null.png">
                                            <p>暂无相关数据</p>
                                        </div>
                                    </td>
                                </tr>
                            </c:otherwise>
                        </c:choose>
                        </tbody>
                    </table>
                </div>
                <%@ include file="../common/pager.jsp"%>
            </div>
        </form>
    </div>
</div>
<script src="${ctx }/static/plugins/chosen_v1.6.2/chosen.jquery.js"></script>
<script type="text/javascript">
    function myQuery(){
        $('#queryForm').submit();
    }

    function myExport(){
        var userName = $("#userName").val();
        window.location.href="${ctx}/patient/export?userName="+userName;
    }
</script>
</body>
</html>